/**
 * File: ChannelWrapper.java
 * Created by: mhaimel
 * Created on: 10 Aug 2009
 * CVS:  $Id: ChannelWrapper.java,v 1.2 2009/10/09 15:16:53 mhaimel Exp $
 */
package uk.ac.ebi.curtain.util.file.impl;

import java.util.concurrent.atomic.AtomicReference;

/**
 * @author mhaimel
 *
 */
public class ChannelWrapper {
	private AtomicReference<Object> channel = new AtomicReference<Object>();
	
	public boolean hasChannel(){
		return null != channel.get();
	}

	public <T> T getChannel() {
		return (T) channel.get();
	}

	public void setChannel(Object channel) {
		this.channel.set(channel);
	}
	
	@Override
	public String toString() {
		return super.toString()+":"+channel.get();
	}
}
